import Vue from "vue";
import App from "./App.vue";
import createRouter from "./router/index.js";
import createStore from "./store/index.js";

// 服务端没有 el, 同样可以返回 store ，router 等属性
export default () => {
  // 服务端每次执行都要创建一个新的 router 实例
  const router = createRouter();
  const store = createStore();
  const app = new Vue({
    router, // 客户端应用中必须要有
    store,
    render: (h) => h(App),
  });
  return { app, router, store };
};
